﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EasyTrader.Signal
{
    public class PriceSignal
    {
#region  Opt Price Value

        private string m_OptSigCode = "";
        public string OptSigCode
        {
            get { return m_OptSigCode; }
            set { m_OptSigCode = value; }
        }
        private int m_OptSigTime = 0;
        public int OptSigTime
        {
            get { return m_OptSigTime; }
            set { m_OptSigTime = value; }
        }
        private double m_OptSigVal = 0.0;
        public double OptSigVal
        {
            get { return m_OptSigVal; }
            set { m_OptSigVal = value; }
        }
        private int m_OptSigType = GlobalVar.OpSignalNone;
        public int OptSigType
        {
            get { return m_OptSigType; }
            set { m_OptSigType = value; }
        }

        // 붕괴된 개수
        private int m_BreakDownCount = 0;
        public int BreakDownCount
        {
            get { return m_BreakDownCount; }
            set { m_BreakDownCount = value; }
        }

        // 돌파된 개수
        private int m_BreakUpCount = 0;
        public int BreakUpCount
        {
            get { return m_BreakUpCount; }
            set { m_BreakUpCount = value; }
        }
        /*
        private EasyTrader.Option.CompVal m_BreakUpVal = null;
        public EasyTrader.Option.CompVal BreakUpVal
        {
            get { return m_BreakUpVal; }
            set { m_BreakUpVal = value; }
        }
        private EasyTrader.Option.CompVal m_BreakDownVal = null;
        public EasyTrader.Option.CompVal BreakDownVal
        {
            get { return m_BreakDownVal; }
            set { m_BreakDownVal = value; }
        }*/

        // 붕괴된 값들의 갯수
        private int m_CallBreakDownCount = 0;
        public int CallBreakDownCount
        {
            get { return m_CallBreakDownCount; }
            set { m_CallBreakDownCount = value; }
        }
        
        private int m_CallBreakUpCount = 0;
        public int CallBreakUpCount
        {
            get { return m_CallBreakUpCount; }
            set { m_CallBreakUpCount = value; }
        }

        private int m_PutBreakUpCount = 0;
        public int PutBreakUpCount
        {
            get { return m_PutBreakUpCount; }
            set { m_PutBreakUpCount = value; }
        }
        private int m_PutBreakDownCount = 0;
        public int PutBreakDownCount
        {
            get { return m_PutBreakDownCount; }
            set { m_PutBreakDownCount = value; }
        }
        
        private double m_CallVal = 0.0;
        public double CallVal
        {
            get { return m_CallVal; }
            set { m_CallVal = value; }
        }
        private int m_CallType = 0;
        public int CallType
        {
            get { return m_CallType; }
            set { m_CallType = value; }
        }
        private int m_CallState = 0;
        public int CallState
        {
            get { return m_CallState; }
            set { m_CallState = value; }
        }
        
        private string m_CallCode = "";
        public string CallCode
        {
            get { return m_CallCode; }
            set { m_CallCode = value; }
        }
        private double m_PutVal = 0.0;
        public double PutVal
        {
            get { return m_PutVal; }
            set { m_PutVal = value; }
        }
        private int m_PutType = 0;
        public int PutType
        {
            get { return m_PutType; }
            set { m_PutType = value; }
        }
        private int m_PutState = 0;
        public int PutState
        {
            get { return m_PutState; }
            set { m_PutState = value; }
        }
       
        private string m_PutCode = "";
        public string PutCode
        {
            get { return m_PutCode; }
            set { m_PutCode = value; }
        }

        private int m_PutBreakTime = 0;
        public int PutBreakTime
        {
            get { return m_PutBreakTime; }
            set { m_PutBreakTime = value; }
        }
        private int m_CallBreakTime = 0;
        public int CallBreakTime
        {
            get { return m_CallBreakTime; }
            set { m_CallBreakTime = value; }
        }
#endregion
        private int m_X = 0;
        public int X
        {
            get { return m_X; }
            set { m_X = value; }
        }
        private double m_Y = 0;
        public double Y
        {
            get { return m_Y; }
            set { m_Y = value; }
        }
        private int m_Type = GlobalVar.SignalNone; // 매수, 매도, 매수 청산, 매도 청산
        public int Type
        {
            get { return m_Type; }
            set { m_Type = value; }
        }
        public int m_Time = 0;
        public int Time
        {
            get { return m_Time; }
            set { m_Time = value; }
        }

        private int m_OpTime = 0;
        public int OpTime
        {
            get { return m_OpTime; }
            set { m_OpTime = value; }
        }
#region  Hoga Variables
        private int m_WaveType = GlobalVar.WaveTypeNone;
        public int WaveType
        {
            get { return m_WaveType; }
            set { m_WaveType = value; }
        }

        private int m_BuyDayHigh = 0;
        public int BuyDayHigh
        {
            get { return m_BuyDayHigh; }
            set { m_BuyDayHigh = value; }
        }
        private int m_SellDayHigh = 0;
        public int SellDayHigh
        {
            get { return m_SellDayHigh; }
            set { m_SellDayHigh = value; }
        }

        private int m_SignalBuyHeight = 0;
        public int SignalBuyHeight
        {
            get { return m_SignalBuyHeight; }
            set { m_SignalBuyHeight = value; }
        }
        private int m_SignalSellHeight = 0;
        public int SignalSellHeight
        {
            get { return m_SignalSellHeight; }
            set { m_SignalSellHeight = value; }
        }
#endregion

#region  Option Variables
        private int m_CallDayHigh = 0;
        public int CallDayHigh
        {
            get { return m_CallDayHigh; }
            set { m_CallDayHigh = value; }
        }
        private int m_PutDayHigh = 0;
        public int PutDayHigh
        {
            get { return m_PutDayHigh; }
            set { m_PutDayHigh = value; }
        }
#endregion

        private int m_LiqCount = 0;
        public int LiqCount
        {
            get { return m_LiqCount; }
            set { m_LiqCount = value; }
        }
        // 신호가 발생한 상태를 나타낸다.
        private int m_SignalState = GlobalVar.SignalStateNone;
        public int SignalState
        {
            get { return m_SignalState; }
            set { m_SignalState = value; }
        }

        private double m_DayMax = 0.0;
        public double DayMax
        {
            get { return m_DayMax; }
            set { m_DayMax = value; }
        }
        private double m_DayMin = 0.0;
        public double DayMin
        {
            get { return m_DayMin; }
            set { m_DayMin = value; }
        }
        private double m_DayCloseMax = 0.0;
        public double DayCloseMax
        {
            get { return m_DayCloseMax; }
            set { m_DayCloseMax = value; }
        }
        private double m_DayCloseMin = 0.0;
        public double DayCloseMin
        {
            get { return m_DayCloseMin; }
            set { m_DayCloseMin = value; }
        }
        private double m_SignalMax = 0.0;
        public double SignalMax
        {
            get { return m_SignalMax; }
            set { m_SignalMax = value; }
        }
        private double m_SignalMin = 0.0;
        public double SignalMin
        {
            get { return m_SignalMin; }
            set { m_SignalMin = value; }
        }
        private double m_SignalCloseMax = 0.0;
        public double SignalCloseMax
        {
            get { return m_SignalCloseMax; }
            set { m_SignalCloseMax = value; }
        }
        private double m_SignalCloseMin = 0.0;
        public double SignalCloseMin
        {
            get { return m_SignalCloseMin; }
            set { m_SignalCloseMin = value; }
        }
        private int m_CurWaveStartX = 0;
        public int CurWaveStartX
        {
            get { return m_CurWaveStartX; }
            set { m_CurWaveStartX = value; }
        }
        private double m_CurWaveStartY = 0.0;
        public double CurWaveStartY
        {
            get { return m_CurWaveStartY; }
            set { m_CurWaveStartY = value; }
        }
        private int m_CurWaveEndX = 0;
        public int CurWaveEndX
        {
            get { return m_CurWaveEndX; }
            set { m_CurWaveEndX = value; }
        }
        private double m_CurWaveEndY = 0.0;
        public double CurWaveEndY
        {
            get { return m_CurWaveEndY; }
            set { m_CurWaveEndY = value; }
        }
        private int m_CurWaveSlope = GlobalVar.PriceFlat;
        public int CurWaveSlope
        {
            get { return m_CurWaveSlope; }
            set { m_CurWaveSlope = value; }
        }

        private double m_CurWaveHigh = 0.0;
        public double CurWaveHigh
        {
            get { return m_CurWaveHigh; }
            set { m_CurWaveHigh = value; }
        }
        private double m_CurWaveLow = 0.0;
        public double CurWaveLow
        {
            get { return m_CurWaveLow; }
            set { m_CurWaveLow = value; }
        }
        private double m_CurWaveCloseMin = 0.0;
        public double CurWaveCloseMin
        {
            get { return m_CurWaveCloseMin; }
            set { m_CurWaveCloseMin = value; }
        }
        private double m_CurWaveCloseMax = 0.0;
        public double CurWaveCloseMax
        {
            get { return m_CurWaveCloseMax; }
            set { m_CurWaveCloseMax = value; }
        }
        private int m_StateNumber = GlobalVar.SignalStateNone;
        public int StateNumber
        {
            get { return m_StateNumber; }
            set { m_StateNumber = value; }
        }

        private int m_LowX = 0;
        public int LowX
        {
            get { return m_LowX; }
            set { m_LowX = value; }
        }
        private int m_HighX = 0;
        public int HighX
        {
            get { return m_HighX; }
            set { m_HighX = value; }
        }
        public PriceSignal Clone()
        {
            PriceSignal newSignal = new PriceSignal();
            newSignal.X = this.X;
            newSignal.Y = this.Y;
            newSignal.Type = this.Type;
            newSignal.Time = this.Time;
            newSignal.CurWaveEndX = this.CurWaveEndX;
            newSignal.CurWaveEndY = this.CurWaveEndY;
            newSignal.CurWaveStartX = this.CurWaveStartX;
            newSignal.CurWaveStartY = this.CurWaveStartY;
            newSignal.CurWaveSlope = this.CurWaveSlope;
            newSignal.CurWaveHigh = this.CurWaveHigh;
            newSignal.CurWaveLow = this.CurWaveLow;
            newSignal.CurWaveCloseMax = this.CurWaveCloseMax;
            newSignal.CurWaveCloseMin = this.CurWaveCloseMin;
            newSignal.DayCloseMax = this.DayCloseMax;
            newSignal.DayCloseMin = this.DayCloseMin;
            newSignal.DayMax = this.DayMax;
            newSignal.DayMin = this.DayMin;
            newSignal.m_StateNumber = this.m_StateNumber;
            newSignal.m_SignalState = this.m_SignalState;
            newSignal.m_SignalCloseMax = this.m_SignalCloseMax;
            newSignal.m_SignalCloseMin = this.m_SignalCloseMin;
            newSignal.m_SignalMax = this.m_SignalMax;
            newSignal.m_SignalMin = this.m_SignalMin;
            newSignal.m_WaveType = this.m_WaveType;
            newSignal.m_BuyDayHigh = this.m_BuyDayHigh;
            newSignal.m_SellDayHigh = this.m_SellDayHigh;
            newSignal.m_SignalBuyHeight = this.m_SignalBuyHeight;
            newSignal.m_SignalSellHeight = this.m_SignalSellHeight;
            newSignal.m_HighX = this.HighX;
            newSignal.m_LowX = this.LowX;
            newSignal.CallDayHigh = this.CallDayHigh;
            newSignal.PutDayHigh = this.PutDayHigh;

            newSignal.CallCode = this.CallCode;
            //newSignal.CallIndex = this.CallIndex;
            newSignal.CallState = this.CallState;
            newSignal.CallBreakTime = this.CallBreakTime;
            newSignal.CallType = this.CallType;
            newSignal.CallVal = this.CallVal;

            newSignal.PutCode = this.PutCode;
            //newSignal.PutIndex = this.PutIndex;
            newSignal.PutState = this.PutState;
            newSignal.PutBreakTime = this.PutBreakTime;
            newSignal.PutType = this.PutType;
            newSignal.PutVal = this.PutVal;

            newSignal.CallBreakDownCount = this.CallBreakDownCount;
            newSignal.CallBreakUpCount = this.CallBreakUpCount;
            newSignal.PutBreakDownCount = this.PutBreakDownCount;
            newSignal.PutBreakUpCount = this.PutBreakUpCount;
            //newSignal.BreakDownVal = this.BreakDownVal;
            //newSignal.BreakUpVal = this.BreakUpVal;
            newSignal.OpTime = this.OpTime;
            newSignal.LiqCount = this.LiqCount;
            newSignal.m_BreakDownCount = this.m_BreakDownCount;
            newSignal.m_BreakUpCount = this.m_BreakUpCount;

            newSignal.m_OptSigCode = this.m_OptSigCode;
            newSignal.m_OptSigTime = this.m_OptSigTime;
            newSignal.m_OptSigVal = this.m_OptSigVal;
            newSignal.m_OptSigType = this.m_OptSigType;

            return newSignal;
        }
    }
}
